{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "file = \"/media/jie/新加卷/pku_data/3571万专利申请全量数据1985-2022年/湖北省.csv\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(file, nrows=10000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0                      刘晓伟; 杨林波; 秦伟\n",
       "1     杨芬; 赵瑞峰; 覃军; 李金亮; 林勇; 张彬; 潘应心\n",
       "2                               雷大有\n",
       "3                  艾勇; 李中才; 王峰; 周启维\n",
       "4                               李家骏\n",
       "                  ...              \n",
       "95                              胡俊明\n",
       "96                              朱傲利\n",
       "97                              罗会全\n",
       "98                     何晓军; 邓克农; 朱仲\n",
       "99                      王盼; 湛秀平; 霍幸\n",
       "Name: 发明人, Length: 100, dtype: object"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"发明人\"][:100]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['专利公开号', '专利名称', '专利类型', '专利摘要', '申请人', '专利申请号', '申请日', '申请公布日',\n",
       "       '授权公布号', '授权公布日', '申请地址', '主权项', '发明人', '分类号', '主分类号', '代理机构', '分案原申请号',\n",
       "       '优先权', '国际申请', '国际公布', '代理人', '省份或国家代码', '法律状态', '专利领域', '专利学科',\n",
       "       '多次公布'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10000"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(df['专利公开号'].unique())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "专利公开号                                           CN212629003U\n",
       "专利名称                                            一种控制柜内部的防护装置\n",
       "专利类型                                                    实用新型\n",
       "专利摘要       本实用新型涉及防护装置的技术领域,特别是涉及一种控制柜内部的防护装置,其当控制柜内的温度过高...\n",
       "申请人                                             湖北卓开系统工程有限公司\n",
       "专利申请号                                       CN202021588868.5\n",
       "申请日                                               2020-08-01\n",
       "申请公布日                                                    NaN\n",
       "授权公布号                                           CN212629003U\n",
       "授权公布日                                             2021-02-26\n",
       "申请地址       430000 湖北省武汉市武汉东湖新技术开发区光谷大道303号光谷芯中心创魔方孵化器2-07...\n",
       "主权项        1.一种控制柜内部的防护装置,其特征在于,还包括控制柜(1)、合页(2)、两组第一柜门(3)...\n",
       "发明人                                             刘晓伟; 杨林波; 秦伟\n",
       "分类号                                        H05K7/20;H05K5/02\n",
       "主分类号                                                H05K7/20\n",
       "代理机构                                                     NaN\n",
       "分案原申请号                                                   NaN\n",
       "优先权                                                      NaN\n",
       "国际申请                                                     NaN\n",
       "国际公布                                                     NaN\n",
       "代理人                                                      NaN\n",
       "省份或国家代码                                                   42\n",
       "法律状态       [{'legal_status_date': '2021-02-26', 'legal_st...\n",
       "专利领域                                                    信息科技\n",
       "专利学科                                                  无线电电子学\n",
       "多次公布                                                     NaN\n",
       "Name: 0, dtype: object"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['实用新型', '外观设计', '发明公开', '发明授权'], dtype=object)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"专利类型\"].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "专利类型\n",
       "实用新型    5680\n",
       "发明公开    3652\n",
       "外观设计     556\n",
       "发明授权     112\n",
       "Name: count, dtype: int64"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"专利类型\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       湖北卓开系统工程有限公司\n",
       "1         武汉海阔科技有限公司\n",
       "2       湖北富博化工有限责任公司\n",
       "3         湖北艾柯泡塑有限公司\n",
       "4     湖北雅图银兴影院投资有限公司\n",
       "           ...      \n",
       "95    湖北浠水科美机械股份有限公司\n",
       "96      湖北泉林医疗设备有限公司\n",
       "97      湖北民泰药业有限责任公司\n",
       "98      湖北九霖机械装备有限公司\n",
       "99    武汉虹信通信技术有限责任公司\n",
       "Name: 申请人, Length: 100, dtype: object"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"申请人\"][:100]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
